import request from './axios'

/**
 * 获取商品分类接口
 * @returns {Promise}
 */
export const getCategories = () => {
  return request({
    url: '/api/categories',
    method: 'GET'
  })
}

/**
 * 获取地区列表接口
 * @returns {Promise}
 */
export const getLocations = () => {
  return request({
    url: '/api/locations',
    method: 'GET'
  })
}

/**
 * 上传图片接口
 * @param {FormData} formData - 包含文件的FormData
 * @returns {Promise}
 */
export const uploadImage = (formData) => {
  return request({
    url: '/api/upload/image',
    method: 'POST',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}